#!/usr/bin/env python

def change_money(coins, change, parts):
    min_coins = change
    if change in coins:
        parts[change] = 1
        return parts[change]
    elif parts[change] > 0:
        return parts[change]
    else:
        for i in [c for c in coins if c <= change]:
            num_coins = 1 + change_money(coins, change - i, parts)
            if num_coins < min_coins:
                min_coins = num_coins
    
    parts[change] = min_coins

    return min_coins


if __name__ == "__main__":
    print(change_money([1, 5, 10, 25], 63, [0 for _ in range(63 + 1)]))